from django.conf.urls import url
from rest_framework.routers import DefaultRouter

from . import views


urlpatterns = [
    # 商品列表
    url(r'^categories/(?P<category_id>\d+)/skus/', views.SKUListView.as_view()),


    # 测试kwargs参数的（没有意义）
    # url(r'^test_kwargs/(?P<category_id>\d+)/$', views.TestKwargs.as_view()),
    # 测试商品详情的查询代码
    # url(r'^goods_detail/(?P<sku_id>\d+)/$', views.TestGoodsDetail.as_view()),
]


router = DefaultRouter()
router.register('skus/search', views.SKUSearchViewSet, base_name='skus_search')

urlpatterns += router.urls